<template>
    <div>子组件</div>
    <hr>
    从爷爷组件接收到de资金:{{money}}
    <button @click="updateMoney(500)">单机增加金额</button>
</template>

<script setup>
import {inject} from 'vue'
let money=inject('money')
let updateMoney=inject('updateMoney')
</script>